<?php

/**
 * Implementation of hook_video_default_presets().
 */
function video_presets_video_default_presets() {
  $items = array(
    'FLV' => array(
      'name' => 'FLV',
      'description' => 'FLv for flash videos.',
      'settings' => array(
        'device_profile' => '0',
        'video_extension' => 'flv',
        'video_codec' => 'flv',
        'video_preset' => 'none',
        'video_quality' => '2',
        'video_speed' => '2',
        'width' => '640',
        'height' => '348',
        'video_aspectmode' => 'preserve',
        'video_upscale' => 0,
        'audio_codec' => 'libmp3lame',
        'audio_quality' => '2',
        'deinterlace' => 'detect',
        'max_frame_rate' => '',
        'frame_rate' => '',
        'video_bitrate' => '0.0002',
        'bitrate_cap' => '',
        'buffer_size' => '',
        'one_pass' => 0,
        'skip_video' => 0,
        'audio_bitrate' => '',
        'audio_channels' => '2',
        'audio_sample_rate' => '44100',
        'skip_audio' => 0,
        'autolevels' => 0,
        'deblock' => 0,
        'denoise' => '0',
        'segmented_type' => '0',
        'segmented_seconds' => '',
        'clip_start' => '',
        'clip_length' => '',
        'cli_code' => '!ffmpeg -i !videofile -s !widthx!height -r 15 -b 250 -ar 22050 -ab 48 !convertfile',
      ),
    ),
    'Mp4' => array(
      'name' => 'Mp4',
      'description' => 'Mp4 with h246 support for iPhone, iPad and HTML5 videos',
      'settings' => array(
        'device_profile' => '0',
        'video_extension' => 'mp4',
        'video_codec' => 'libx264',
        'video_preset' => 'libx264-hq',
        'video_quality' => '2',
        'video_speed' => '2',
        'width' => '640',
        'height' => '348',
        'video_aspectmode' => 'preserve',
        'video_upscale' => 0,
        'audio_codec' => 'libmp3lame',
        'audio_quality' => '2',
        'deinterlace' => 'detect',
        'max_frame_rate' => '',
        'frame_rate' => '',
        'video_bitrate' => '',
        'bitrate_cap' => '',
        'buffer_size' => '',
        'one_pass' => 0,
        'skip_video' => 0,
        'audio_bitrate' => '',
        'audio_channels' => '2',
        'audio_sample_rate' => '48000',
        'skip_audio' => 0,
        'autolevels' => 0,
        'deblock' => 0,
        'denoise' => '0',
        'segmented_type' => '0',
        'segmented_seconds' => '',
        'clip_start' => '',
        'clip_length' => '',
        'cli_code' => '!ffmpeg -i !videofile -y -acodec libmp3lame -ab 96k -vcodec libx264 -vpre ultrafast -crf 10 -threads 0 -ar 44100 -s !widthx!height -r 20 !convertfile',
      ),
    ),
    'Ogg' => array(
      'name' => 'Ogg',
      'description' => 'Ogg is a free, open standard container format maintained by the Xiph.Org Foundation.',
      'settings' => array(
        'device_profile' => '0',
        'video_extension' => 'ogg',
        'video_codec' => 'libtheora',
        'video_preset' => 'none',
        'video_quality' => '2',
        'video_speed' => '2',
        'width' => '640',
        'height' => '348',
        'video_aspectmode' => 'preserve',
        'video_upscale' => 0,
        'audio_codec' => 'libvorbis',
        'audio_quality' => '2',
        'deinterlace' => 'detect',
        'max_frame_rate' => '',
        'frame_rate' => '',
        'video_bitrate' => '200',
        'bitrate_cap' => '',
        'buffer_size' => '',
        'one_pass' => 0,
        'skip_video' => 0,
        'audio_bitrate' => '',
        'audio_channels' => '2',
        'audio_sample_rate' => '11025',
        'skip_audio' => 0,
        'autolevels' => 0,
        'deblock' => 0,
        'denoise' => '0',
        'segmented_type' => '0',
        'segmented_seconds' => '',
        'clip_start' => '',
        'clip_length' => '',
        'cli_code' => '!ffmpeg2theora -o !convertfile !videofile',
      ),
    ),
    'WebM' => array(
      'name' => 'WebM',
      'description' => 'WebM files consist of video streams compressed with the VP8 video codec and audio streams compressed with the Vorbis audio codec',
      'settings' => array(
        'device_profile' => '0',
        'video_extension' => 'webm',
        'video_codec' => 'vp8',
        'video_quality' => '2',
        'video_speed' => '2',
        'width' => '640',
        'height' => '348',
        'video_aspectmode' => 'preserve',
        'video_upscale' => 0,
        'audio_codec' => 'aac',
        'audio_quality' => '2',
        'deinterlace' => 'detect',
        'max_frame_rate' => '',
        'frame_rate' => '',
        'video_bitrate' => '',
        'bitrate_cap' => '',
        'buffer_size' => '',
        'one_pass' => 0,
        'skip_video' => 0,
        'audio_bitrate' => '',
        'audio_channels' => '2',
        'audio_sample_rate' => '',
        'skip_audio' => 0,
        'autolevels' => 0,
        'deblock' => 0,
        'denoise' => '0',
        'segmented_type' => '0',
        'segmented_seconds' => '',
        'clip_start' => '',
        'clip_length' => '',
        'cli_code' => '!ffmpeg -y -pass 1 -passlogfile !videofile -threads 16  -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -i !videofile -vcodec libvpx -b 204800 -s !widthx!height -aspect 4:3 -an -f webm -y NUL && !ffmpeg -y -pass 2 -passlogfile !videofile -threads 16  -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -i !videofile -vcodec libvpx -b 204800 -s !widthx!height -aspect 4:3 -acodec libvorbis -ac 2 -y !convertfile',
      ),
    ),
  );
  return $items;
}
